#include <iostream>
#include <stdio.h>

using namespace std;

int main() {
    int n,n2=1,n3=0;
    cin >> n;
    for(int i = 1; i <= n; i++){
        n2=1;
        for(int j = 1; j <= i; j++){
            n2*=j;
        }
        n3+=n2;
    }
    cout << n3;
    return 0;
}